public class Day_10_1_井字棋 {
    public boolean checkWon(int[][] board) {
        // write code here
        int x = board.length;
        int y = board[0].length;
        int[][] arr = new int[x][y];
        for (int i = 0; i < x; i++) {
            //判断行
            int sum_row = 0;
            int sum_cow = 0;
            for (int j = 0; j < y; j++) {
                sum_row += arr[i][j];
                sum_cow += arr[j][i];
            }
            if(sum_row == x || sum_cow == y){
                return true;
            }
        }
        //看对角线
        int first = 0;
        int second = 0;
        for (int i = 0; i < x; i++) {
            first += arr[i][i];
            second += arr[i][y-1-i];
        }
        if(first == x || second == y){
            return true;
        }
        return false;
    }
}
